/*
 * @Author:
 * @Date: 2021-12-10 08:57:52
 * @LastEditTime: 2022-02-23 08:54:26
 * @LastEditors: Please set LastEditors
 * @Description: 能源管理 实时数据接口
 */
import req from "@/api/axios";
export default {
  // 首先先查能源类型，比如电力，水力
  getEnergyType(params) {
    return req.post("/om/v1/energyType/queryEnergyTypePage", params);
  },
  // 根据能源类型的energyTypeId获取电表或水表列表
  getEnergyWatch(params) {
    return req.post("/om/v1/energyEquipment/queryPageList", params);
  },
  // 根据电表的id查找对应的折线图跟柱状图数据
  getPicture(energyEquipmentCoding) {
    return req.get(
      `/om/v1/energy/queryEnergyForDay/${energyEquipmentCoding}`
    );
  },
  /**
   * @description: 实时数据监测-能耗用量
   * @return {Array}
   */
  queryElectricEnergyForDays(params) {
    return req.get(`/om/v1/energy/queryEnergyForDay/${params}`);
  },
  queryElectricEnergyForDay(params) {
    return req.get(`/om/v1/energy/queryNearly24?energyEquipmentCoding=${params}`);
  },
  /**
   * @description: 实时数据监测-能耗累积量
   * @return {Array}
   */
  queryElectricEnergyTotal(params) {
    return req.get(`om/v1/energy/queryEnergyTotal/${params}`);
  },
  /**
   * @description: 历史数据监测-能耗累计量（电）
   * @param {String/Number}energyEquipmentCoding
   * @param {String/Number}fatalism
   *  @param {String/Number}accuracy
   * @return {Array}
   */
  queryElectricEnergyHistory(params) {
    return req.post("/om/v1/energy/queryEnergyHistory", params);
  },
  /**
   * @description: 历史数据监测-能耗用量（电）
   * @param {String/Number}energyEquipmentCoding
   * @param {String/Number}fatalism
   *  @param {String/Number}accuracy
   * @return {Array}
   */
  queryElectricHistoryDosage(params) {
    return req.post("/om/v1/energy/queryHistoryDosage", params);
  },
  /**
   * @description: 历史数据监测-能耗累计量（水）
   * @param {String/Number}energyEquipmentCoding
   * @param {String/Number}fatalism
   *  @param {String/Number}accuracy
   * @return {Array}
   */
  queryWaterEnergyHistory(params) {
    return req.post("/om/v1/energy/queryEnergyHistory", params);
  },
  /**
   * @description: 历史数据监测-能耗用量（水）
   * @param {String/Number}energyEquipmentCoding
   * @param {String/Number}fatalism
   *  @param {String/Number}accuracy
   * @return {Array}
   */
  queryWaterHistoryDosage(params) {
    return req.post("/om/v1/energy/queryHistoryDosage", params);
  }
};
